package com.jinxin.platform.cdqzsqacs.bean.enums;

/**
 * All rights Reserved, Designed By www.beonelot.com
 *
 * @version: V1.0
 * @Copyright: www.beonelot.com Inc. All rights reserved.
 * @Description：
 * @Date: 2021-03-03
 * @Author: Lingnan
 **/

/**
 * 人员新增处理结果状态码
 */
public enum ResultCode {
    CODE_0(0,"新增成功"),
    CODE_1000(1000,"算法初始化失败"),
    CODE_1001(1001,"人脸检测失败"),
    CODE_1002(1002,"图片未检测到人脸"),
    CODE_1003(1003,"jpeg照片解码失败"),
    CODE_1004(1004,"图片质量分数不满足"),
    CODE_1005(1005,"图片缩放失败（即图片分辨率不满足要求，请将图片缩放后再下发）"),
    CODE_1006(1006,"未启用智能"),
    CODE_1007(1007,"导入图片过小"),
    CODE_1008(1008,"导入图片过大"),
    CODE_1009(1009,"导入图片分辨率超过1920*1080"),
    CODE_1010(1010,"导入图片不存在"),
    CODE_1011(1011,"人脸元素个数已达到上限"),
    CODE_1012(1012,"智能棒算法模型不匹配"),
    CODE_1013(1013,"人脸导入库成员证件号非法"),
    CODE_1014(1014,"人脸导入库成员图片格式错误"),
    CODE_1015(1015,"通道布控已达设备能力上限"),
    CODE_1016(1016,"其它客户端正在进行操作人脸库"),
    CODE_1017(1017,"人脸库文件正在更新中"),
    CODE_1018(1018,"Json反序列化失败"),
    CODE_1019(1019,"Base64解码失败"),
    CODE_1020(1020,"人脸照片，编码后的大小和实际接收到的长度不一致，关注Data和Size大小是否正确");

    private int code;
    private String desc;

    ResultCode(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    // 普通方法
    public static String getDesc(int code) {
        for (ResultCode c : ResultCode.values()) {
            if (c.getCode() == code) {
                return c.desc;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
